<template>
    <div>
        <table class="table table-bordered">
            <tbody>
                <tr>
                <td>项目名称</td>
                <td><input type="text" v-model="querinfo.shopName"></td>
            </tr>
            <tr>
                <td>项目编码</td>
                <td><input type="text" v-model="querinfo.showCord"></td>
            </tr>
            <tr>
                <td>佣金</td>
                <td><input type="text" v-model="querinfo.money"></td>
            </tr>
            <tr>
                <td>服务人数</td>
                <td><input type="text" v-model="querinfo.people"></td>
            </tr>
            <tr>
                <td>服务时长</td>
                <td><input type="text" v-model="querinfo.time"></td>
            </tr>
            <tr>
                <td>项目说明</td>
                <td><textarea v-model="querinfo.shuom"></textarea></td>
            </tr>
            <tr>
                <td>状态</td>
                <td><input type="radio" name="state" :value="1" v-model="querinfo.state">启用
                <input type="radio" name="state" :value="0" v-model="querinfo.state">禁用</td>
            </tr>
            <tr>
                <td></td>
                <td><input type="button" @click="ok" value="添加"></td>
            </tr>
            </tbody>
            
        </table>
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import moment from 'moment';

import { ref,reactive } from 'vue';
import { useRoute ,useRouter} from 'vue-router';
const router=useRouter();
const route=useRoute();
let querinfo:any=reactive({

  "shopName": "",
  "showCord": moment(new Date()).format('YYYYMMDD')+Math.random().toString().substring(2,5),
  "money": "",
  "people": "",
  "time": "",
  "shuom": "",
  "state": "",

})

const ok=()=>{
    axios({
        url:'/api/Show/AddShop',
        method:'post',
        data:querinfo
    })
    .then(res=>{
        if(res.data==-1)
    {
        alert("项目名称重复")  
        return; 
    }
    else if(res.data>=0)
    {
        alert("添加成功");
        return;
    }
    else
    {
        alert("添加失败");
        return;
    }
    })
}

</script>

<style scoped>

</style>